This class is meant as an emulation of SCNumberBox. last mod: 16-Jan-08 sciss
Also refer to JSCView for different behaviour affecting all widgets
| no-op / not working | |
| typingColor | not effective |
| different behaviour | |
| class hierarchy | JSCTextField and JSCNumberBox are subclasses of JSCTextEditBase |
| alignment | default alignment is right (more useful for numbers) |
| extended functionality | |
| minDecimals | adjust the minimum number of decimals that is displayed |
| maxDecimals | adjust the maximum number of decimals that is displayed |
| known issues / todo | |
| actions | pressing escape will not fire an action |
Note: please use the abstraction layer GUI.numberBox if possible! (see GUI)
A view to type in integer or decimals numbers.
(
var w;
w = JSCWindow( "JSCNumberBox" );
b = JSCNumberBox( w, Rect( 10, 10, 100, 30 ));
b.value = rrand( 1, 15 );
b.action = { arg numb; numb.value.postln };
w.front;
)
// does not do the action
b.value = rrand( 1, 15 );
b.boxColor = Color.grey;
b.stringColor = Color.green;
b.align = \center;
// minimum / maximum number of decimals (works only with SwingOSC!)
b.value = 3.1;
b.minDecimals = 2;
b.value = pi;
b.maxDecimals = 3;
... not active at the moment! most keyboard events are handled by the look-and-feel
return | commit edit |
csr up/down | increase/decrease value by 1.0 |